//
//  XMViewController.m
//  XMLiveKit
//
//  Created by lishi on 2019/5/16.
//  Copyright © 2019 lishi. All rights reserved.
//

#import "XMViewController.h"

// Controller
#import "XMLiveViewController.h"

// Libs
#import "XMLiveKit.h"

@interface XMViewController ()

@property (nonatomic, strong) UIButton *beginButton;

@end

@implementation XMViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self.view addSubview:self.beginButton];
    [self.beginButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view);
    }];
    
}

- (void)beginClick:(UIButton *)sender {
    [self.navigationController pushViewController:[XMLiveViewController new] animated:YES];
}

- (UIButton *)beginButton {
    if (!_beginButton) {
        _beginButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [_beginButton setTitle:@"开始直播" forState:UIControlStateNormal];
        [_beginButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
        [_beginButton addTarget:self action:@selector(beginClick:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _beginButton;
}

@end
